import request from '@/utils/request'

function url(u) {
  const prefix = '/dept'
  return `${prefix}${u || ''}`
}

export function findDeptById(id) {
  return request({
    url: url(`/${id}`),
    method: 'get'
  })
}

export function saveDept(dept) {
  return request({
    url: `/a/dept`,
    method: 'post',
    data: dept
  })
}

export function deleteDeptById(id) {
  return request({
    url: `/a/dept/${id}`,
    method: 'delete'
  })
}

export function findAllDept() {
  return request({
    url: url(),
    method: 'get'
  })
}
